﻿using System.Collections.Generic;
using System.Web;

namespace BabyShop.Site.Foundation
{
    public class SessionContainer : PersistentDataContainer
    {
        public readonly string SessionKeyName = typeof(SessionContainer).ToString();

        protected override IDictionary<string, object> RecoveryStore()
        {
            return (Dictionary<string, object>) HttpContext.Current.Session[SessionKeyName];
        }

        protected override void PersistentStore(IDictionary<string, object> store)
        {
            HttpContext.Current.Session[SessionKeyName] = store;
        }
    }
}